import Vue from "vue";
//路由管理器（两个标签：router-link router-view）
import VueRouter from "vue-router";

//将 路由管理器 注册到 Vue中
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "home",
    // component: HomeView,
  },
];

const router = new VueRouter({
  //注入路由器
  routes,
});

router.beforeEach((to, from, next) => {
  //设置每个页面的标题
  document.title = to.meta.name || "头条";
  next();
});

export default router;
